package com.yxkj.syh.app.huarong.bean;

import com.yxkj.syh.app.huarong.R;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 创建者：SYH
 * 时间：2020/5/25 16:08
 * 编辑者：SYH、
 * 标签：收款方式
 * 补充说明：
 */
public class Payment implements Serializable {
    private String accountName;//开户名
    private int auto; //是否默认
    private String bankName;//银行名称
    private String cardNumber;//卡号
    private String createTime;
    private String creator;
    private String id;
    private String openingBank;//开户行
    private String remark;
    private String supplierId;//供应商id
    private String supplierName;
    private String updateTime;
    private String updator;
    private String used;//状态
    private int version;

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public int getAuto() {
        return auto;
    }

    public void setAuto(int auto) {
        this.auto = auto;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOpeningBank() {
        return openingBank;
    }

    public void setOpeningBank(String openingBank) {
        this.openingBank = openingBank;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(String supplierId) {
        this.supplierId = supplierId;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdator() {
        return updator;
    }

    public void setUpdator(String updator) {
        this.updator = updator;
    }

    public String getUsed() {
        return used;
    }

    public void setUsed(String used) {
        this.used = used;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public Map<String, Object> getRequest() {
        Map<String, Object> pMap = new HashMap<>();
        pMap.put("bankName", bankName);
        pMap.put("accountName", accountName);
        pMap.put("cardNumber", cardNumber);
        pMap.put("openingBank", openingBank);
        pMap.put("auto", auto);
        pMap.put("id", id);
        pMap.put("supplierId", supplierId);
        return pMap;
    }

    public int getLogoId() {
        switch (bankName) {
            case "网银":
                return R.mipmap.ic_bank_card;
            case "支付宝":
                return R.mipmap.ic_alipay;
            case "微信":
                return R.mipmap.ic_wecaht_pay;
            default:
                return R.mipmap.ic_launcher;
        }
    }

    public String bankAndCardid() {
        if (cardNumber.length() >= 4) {
            return bankName + "：(" + cardNumber.substring(cardNumber.length() - 4) + ")";
        } else {
            return bankName + "：(" + cardNumber + ")";
        }
    }


}
